<?php $this->load->module('mobile/index/header', $common);?>

<div class="content">

    <div class="menu-wrap">
        <ul>
            <li <?php if($type == '0'):?>class="current"<?php endif;?>><a href="<?php echo $index_url;?>">全部订单</a></li>
            <li <?php if($type == '1'):?>class="current"<?php endif;?>><a href="<?php echo $index_url.'?type=1';?>">已完成订单</a></li>
            <li <?php if($type == '2'):?>class="current"<?php endif;?>><a href="<?php echo $index_url.'?type=2';?>">未完成订单</a></li>
        </ul>
    </div>
    <?php if($datalist):?>
    <div id="list">
        <?php foreach ($datalist as $v): ?>
            <a href="<?php echo $v['link'];?>">
                <div class="list-item fn-clear">
                    <div class="info">
                        <h5><?php echo $v['scenic_name'];?></h5>
                        <div class="i-note">
                            <p class="price">
                                <?php if (!empty($v['order_account'])) :?>
                                    ¥<?php echo $v['order_account'];?>
                                <?php endif; ?>
                            </p>
                            <p class="c_mt">订单编号：<?php echo $v['order_sn'];?></p>
                            <p class="c_mt">订单状态：<?php echo $v['order_status_name'];?></p>
                            <p class="c_mt">入住时间：<?php echo $v['start_date'];?></p>
                            <p class="c_mt">离店时间：<?php echo $v['end_date'];?></p>
                            <p class="c_mt">下单时间：<?php echo $v['add_time'];?></p>
                        </div>
                    </div>
                    <span class="arrow-right"></span>
                </div>
            </a>
        <?php endforeach ;?>

    </div>
      <!--  <a href="javascript:;" class="btn-grey btn">加载更多</a>-->
    <?php else:?>


        <div class="null-wrap">
            <img src="<?php echo URLPRE; ?>static/template/<?php echo MOBILE_TEMPLATE_NAME ?>/mobile/images/null.png" alt="">
            <p>您的订单空空如也</p>
            <a href="<?php echo site_url('mobile/hotel/book');?>">立即预定</a></div>

    <?php endif;?>
</div>
<?php $this->load->module('mobile/index/footer', $common);?>
<script type="text/javascript">
    $(function(){
        var slid = $("#sliderimg").slider({
            loop: true
        });
        var page = <?php echo $page+1;?>;

       /* var url = '<?php echo site_url('mobile/order/ticket_list');?>';
        $('.btn-grey').click(function(){
            var $this = $(this);
            $this.text('加载中...');
            $.get(url+(url.indexOf('?')!=-1 ?'&':'/?')+'isajax=1&page='+page, function(data){

                if(data.length>0){
                    var html = '';
                    for(var i =0; i<data.length; i++){
                        var item = data[i];
                        html += '<a href="">' +
                            '<div class="list-item fn-clear"><div class="info">' +
                            '<h5>'+ item.scenic_name +'</h5>' +
                            '<div class="i-note"><p><span class="price">'+item.order_account+'</span></p>' +
                            '<p><span>订单编号：'+ item.order_sn +'</span></p>' +
                            '<p><span>订单状态：'+ item.order_status_name +'</span></p>' +
                            '<p><span>出行时间：'+ item.user_date +'</span></p>' +
                            '<p><span>下单时间：'+ item.add_time +'</span></p>' +
                            '</div></div><span class="arrow-right"></span></div></a>';
                    }
                    $('#list').append(html);
                    page ++;
                }else{

                    $.dialog({
                        style:'tip',
                        width:200,
                        closeTime:1000,
                        content: '<p style="text-align: center">没有更多了</p>'
                    }).open();
                }
                $this.text('加载更多');
            },'json');
        });*/

    });
</script>